This invention relates generally to a method and system for generating a random number for a computing device.
As is well known, it is not truly possible to generate a random number using a computing device, such as a microprocessor or computer. In particular, a computer cannot perform a computation to generate a pure random number. There are well known techniques for generating pseudo-random numbers in which some form of mathematical equation is used to simulates a randomness of a number sequence. To make the result of the equation (which is known) random, most pseudo-random number generators use a well known random seed which provides a random time offset so that other people may know the mathematical equation that is being used, but do not know the random seed being used. One technique for generating a random seed may take advantage of random user input, such as random key strikes or random mouse movements, in order to generate the random seed. This technique obviously requires the user to actively do something to generate the random seed. It would be preferably to provide an automatic method for generating a random seed that is, in fact, random.
Thus, it is desirable to provide a random number generation system and method and it is to this end that the present invention is directed.
The random number generation system in accordance with the invention overcomes the above problem with a generation of a random seed by utilizing randomness of physical world properties, such as impurities of hardware components and environmental irregularities of a individual systemxe2x80x94in terms of temperature, voltage and manufacturing process. In particular, when a computer system is first manufactured, the circuits are in different random states depending on various factors. The important point is that no human being has any idea of the state of the circuitry at start-up and the path it takes to get to a known state. Therefore, in accordance with the invention, the randomness of the circuitry may be used to automatically generate a random seed that may be used in turn to generate a pseudo-random or random number.
In the preferred embodiment, most computer systems have a well known phase locked loop (PLL) which is designed to lock onto a reference clock signal. However, during the start-up or reset of the computer system, the PLL will overshoot and undershoot the clock frequency as the PLL counter attempts to lock onto the proper clock frequency. The time it takes and the number of overshoots and undershoots for the PLL to lock onto that reference clock frequency is largely un-deterministic due to the individual characteristics of electronic components and various composition and environmental states of electronic circuits during the powering up process. Consequently, the time that it takes for the PLL to lock onto the clock frequency is known as tSETTLE and is a random time period. In accordance with the invention, the time that it takes the PLL to lock onto the clock frequency and the number of clock ticks the PLL generated during this time of instability may be used as a random seed that is then used to generate a pseudo-random number in accordance with the invention. In addition, the PLL in the computer may be forced into unstable conditions to generate a new random seed in accordance with the invention.
Thus, in accordance with the invention, a random number generator is provided that comprises an electrical circuit that has an unstable state and a stable state which it settles into after a random period of time, a counter that determines the number of PLL ticks that it took for the electrical circuit to settle into the stable state and a generator that generates a random number using the settle time as the random seed. A random number generation method is also provided.
In accordance with another aspect of the invention, a random seed generator is provided that comprises an electrical circuit that has an unstable state and a stable state which it settles into after a random period of time and a counter that determines the time that it takes for the electrical circuit to settle into the stable state wherein the settle time corresponds to a random seed for generating a random number. A method for generating a random seed is also provided.
In accordance with yet another aspect of the invention, a computer system that generates a random number is provided. The computer system comprises a phase locked loop circuit that has an unstable state and a stable state that it enters after some random period of time, a counter for determining the period of time for the phase locked loop to settle into the stable state, the settle time corresponding to a random seed, and a generator for applying the random seed to a random number generator in order to generate a random number.